<?php
/**
 * 邮件
 */
import('ORG.Mail.YMail');
class MailAction {
	private $configFile = './Core/mail.conf.php';
	private $m = null;
	
	public function __construct($config = null) {
		$options = null;
		if(!empty($config)) {
			$options = $config;
		} else {
			$options = include $this->configFile;
		}
		$this->m = new YMail($options);
	}
	
	public function getMsg() {
		return $this->m->getMsg();
	}
	
	public function sendMail($toEmail, $subject, $body) {
		$r = $this->m->sendMail($toEmail, $subject, $body);
		
		return $r;
	}
}
